import axios from '../../../plugins/axios'
import { TeacherActionsEnum } from '../../../_/vue/store/teacher'

export default {
  [TeacherActionsEnum.LIST] ({ commit }, params) {
    return axios.get('/teachers', { params })
  },
  [TeacherActionsEnum.STORE] ({ commit }, data) {
    return axios.post('/teachers', data)
  },
  [TeacherActionsEnum.EDIT] ({ commit }, id) {
    return axios.get(`/teachers/${id}`)
  },
  [TeacherActionsEnum.SAVE] ({ commit }, payload) {
    return axios.post(`/teachers/${payload.id}`, payload.data)
  },
  [TeacherActionsEnum.DELETE] ({ commit }, ids) {
    return axios.delete('/teachers', { data: ids })
  },
  [TeacherActionsEnum.SELECT] ({ commit }) {
    return axios.get('/teachers/select')
  }
}
